package com.csc.bankingsystem.core.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonManagedReference;

/**
 * TokenRecord Data Transfer Object
 * 
 * @author angelkid
 *
 */
@Entity
@Table(name = "TOKENRECORD")
public class TokenRecord  extends BankingSystemAbstractEntity {
	private String tokenMD5;
	private UserInfo userInfo;
	private Date expireDate;
	
	@Column(name = "tokenMD5", nullable = false, length = 45)
	public String getTokenMD5() {
		return tokenMD5;
	}
	public void setTokenMD5(String tokenMD5) {
		this.tokenMD5 = tokenMD5;
	}
	
	@JsonManagedReference
	@OneToOne
	@JoinColumn(name="userInfoId")
	public UserInfo getUserInfo() {
		return userInfo;
	}
	public void setUserInfo(UserInfo userInfo) {
		this.userInfo = userInfo;
	}
	
	@Column(name = "expireDate", length = 45)
	public Date getExpireDate() {
		return expireDate;
	}
	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}
}
